home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / oper_sys / quartz / quartz10.lha / src / presto / main.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-05-02  |  1.5 KB  |  58 lines

  1. //
  2. // Modification History:
  3. // 
  4. // 12-Jan-90   JEF
  5. // Add support for processor affinity on Sequent Symmetry.
  6. //
  7. // 04-Jan-90   JEF
  8. // Add stacksize, get_stacksize(), and get_numprocessors().
  9. // Move most of constructor into run() and invoke run() from main
  10. // function after constructor returns.  This allows us to access the
  11. // above new functions from elsewhere in the program.
  12. //
  13.  
  14. class Main    {
  15.     int numprocessors;        // # scheduling processors
  16.     int nummainthreads;        // # threads in Main::main()
  17.     int mainstacksizes;        // size of stack for each of the
  18.                                         //   nummainthreads threads
  19.     int stacksize;            // size of stack for all other threads
  20.     int quantum;            // scheduling quantum
  21. #ifdef i386
  22.     int affinity;                   // if non-zero, processor affinity will
  23.                                         //   be attempted via tmp_affinity
  24. #endif i386
  25. #ifdef PROFILE
  26.     int numprofilers;
  27. #endif
  28.     int argc;            // argc from main
  29.     char **argv;            // argv from main
  30.     char **envp;            // envp from main
  31. public:
  32.     Main(int ac, char **av, char **ep);
  33.     ~Main();
  34.     int  preallocthreads(int cnt, int sz = DEFSTACKSIZ);
  35.     void run ();
  36.     int init();        // user provides 
  37.     int main();        //    init, main, done...
  38.     int done();        //
  39.     int get_numprocessors ()
  40.         { return numprocessors; }
  41.     int get_nummainthreads ()
  42.         { return nummainthreads; }
  43.     int get_mainstacksizes ()
  44.         { return mainstacksizes; }
  45.     int get_stacksize ()
  46.         { return stacksize; }
  47. #ifdef i386
  48.     int get_affinity ()
  49.         { return affinity; }
  50. #endif i386
  51. };
  52.  
  53.  
  54. #define MAINNAME    "MAIN"
  55.  
  56.  
  57.  
  58.